package com.wc._16届国特冲刺营._03动态规划心法_线性DP最优决策链构建.健身;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2025/5/7 14:53
 * @description
 * https://www.lanqiao.cn/courses/51805/learning/?id=4072894&compatibility=false
 */
public class Main {
    /**
     * 思路：
     * 完全背包问题, 用完全背包的模板
     */
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 200010;
    static long[] f = new long[N];
    static int[] s = new int[N];
    static int n, m, q;

    public static void main(String[] args) {
        m = sc.nextInt();
        n = sc.nextInt();
        q = sc.nextInt();
        for (int i = 1; i <= q; i++) {
            int x = sc.nextInt();
            s[x]++;
        }
        for (int i = 1; i <= m; i++) s[i] += s[i - 1];

        for (int i = 1; i <= n; i++) {
            int v = 1 << sc.nextInt(), w = sc.nextInt();
            for (int j = v; j <= m; j++) {
                // 保证这一段区间内是无其他安排的
                if (s[j] - s[j - v] == 0) {
                    f[j] = Math.max(f[j], f[j - v] + w);
                }
            }
        }
        long res = 0;
        // 统计每一个区间内部的最后一天, 其中是有0的范围的
        for (int i = 1; i <= m + 1; i++) {
            if (f[i] == 0) res += f[i - 1];
        }
        out.println(res);
        out.flush();
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}

